package core.database.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity(name = "core.AdministratorToken")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "administratorTokens")
public class AdministratorToken implements Serializable {
	private static final long serialVersionUID = -8432429026234505917L;
	
	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id = null;
	@Column(name = "value", nullable = false, unique = true, length = 45)
	private String value;
	@ManyToOne
	@JoinColumn(name = "member", insertable = false, updatable = true)
	private Member member;
	
	public Long getId() {
		return id;
	}

	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}
}
